package lanqiao.dontaiguihua.meiju;

public class Lan2381 {
    public static void main(String[] args) {
        for(int i=4496;;i++){
            String s=""+i*(i+1)/2;
            StringBuffer sb=new StringBuffer(s);
            if(s.equals(sb.reverse().toString())){
                System.out.println(s);
                return;
            }
        }
    }
}
